#ifndef ELEMENT_H
#define ELEMENT_H

#include <QObject>

class Poly;

class Element : public QObject
{
    Q_OBJECT
public:
    explicit Element(QObject *parent = 0);
    
    virtual void draw() const = 0;

    inline QTransform transform() const;
    virtual void updateTransform();

    void setPos(QPointF pos);
    const QPointF& pos() const;

    void setAngle(float fAngle);
    float angle() const;

    void setScale(QPointF scale);
    const QPointF& scale() const;

    QPointer<Document> document() const;
protected:
    QPainterPath m_Shape;
private:
    ValueWithPast<QPointF> m_pos;
    ValueWithPast<float>   m_fAngle;
    ValueWithPast<QPointF> m_scale;
signals:
    void elementChanged();
public slots:
    
};

#endif // ELEMENT_H
